#ifndef GAMEMOTIONSTATE_H
#define GAMEMOTIONSTATE_H

#include "LinearMath\btMotionState.h"
#include "LinearMath\btVector3.h"
#include "BaseObject.h"

class GameMotionState : public btMotionState
{
public:
	GameMotionState(const btTransform &pos, ObjectPtr &obj, const btVector3 &offset = btVector3(0.0f,0.0f,0.0f));
	GameMotionState(ObjectPtr &object, const btVector3 &offset = btVector3(0.0f,0.0f,0.0f));
	virtual ~GameMotionState(void);
	ObjectPtr &getObject();
	virtual void getWorldTransform(btTransform &trans) const;
	virtual void setWorldTransform(const btTransform &trans);
	btTransform getOffset(void);
protected:
	btTransform mPosition;
	btTransform mOffset;
	ObjectPtr mpBaseObject;
	btTransform vecToMat(const btVector3& vec);
};

#endif